<?php
$this->breadcrumbs=array(
	'Periodos'=>array('index'),
	'Gerenciar',
);

$this->menu=array(
	array('label'=>'Listar Periodos', 'url'=>array('index')),
	array('label'=>'Criar Periodos', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('cad-periodo-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Periodos</h1>


<?php
// echo CHtml::link('Busca Avançada','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php
//$this->renderPartial('_search',array(
//	'model'=>$model,
//)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'cad-periodo-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'cod_periodo',
                array(
                       'name'=>'cod_polo',
                       'type'=>'raw',
                       'value'=>'cad_polo::loadTablePolo($data->cod_polo)'
                    ),
		'nome',
                array(
                       'name'=>'status',
                       'type'=>'raw',
                       'value'=>'Lookup:: item("Status",$data->status)'
                     ),
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
